package com.longxiao.enums;

/**
 * Created by houhongwei on 2017/4/28.
 */
public enum  ResultCode {

    // 通用
    SUCCESS("0000", "OK", "success"),
    FAIL("9999", "系统繁忙请稍后再试", "System busy, please try again later!"),


    PARAM_ERROR("1701", "缺少必要参数，提交时参数不全", "Fail to validate input parameters!"),
    PARAM_NOT_LEGAL("1702", "提交的参数存在不合法内容", "Parameter is not legal!"),

    MOBILE_NOT_SUPPORT("1711", "不支持的手机号码", "Mobile phone number is not supported!"),
    AUTH_CODE_SENDS_TOO_OFTEN("1712", "短信验证码发送过于频繁", "The authentication method sends too often!"),
    AUTH_CODE_ERR("1713", "验证码错误", "Verify code error"),
    TOKEN_IS_EXPIRED("1721", "授权码已过期", "Token is expired"),
    UNAUTHORIZED_OPERATION("1722", "未经授权的操作", "Unauthorized operation!"),
    DATA_NOT_FOUND("1723", "指定数据不存在", "Data not found!"),
    SUPPLEMENTAL_USER_INFO("1724", "请补充个人资料", "Please supplemental user information!"),
    
    FILE_UPLOAD_FAIL("1725","上传文件失败","file upload fail"),
    FILE_TYPE_ILLEGAL("1726","文件类型异常","file type illegal"),
    
    COURSE_NOT_EXISTS("1840","课程信息不存在","course not exists"),
    CHAPTER_NOT_EXISTS("1840","章节信息不存在","chapter not exists"),
    CLASSROOM_NOT_EXISTS("1842","教室信息不存在","classroom not exists"),
    TEACHER_LECTURE_NOT_EXISTS("1843","老师课时信息不存在","teacher lecture not exists"),
    STUDENT_LECTURE_NOT_EXISTS("1844","学生信息不存在","student lecture not exists"),

    // 学生注册
    MOBILE_IS_EXISTS("1111", "手机号已存在，请更换其他号码", "Mobile is exists!"),
    PASSWORD_IS_TO_SHORT("1112", "密码不足6位", "Less than 6 passwords"),
    EMAIL_IS_EXISTS("1113", "邮箱已存在，请更换其他邮箱", "The mailbox already exists. Please change another mailbox"),

    // 个人资料填写
    GENDER_NOT_FOUND("1121", "性别未填写", "Gender is not found"),
    BIRTHDAY_NOT_FOUND("1122", "出生日期未填写", "Birthday is not found"),
    CITY_NOT_FOUND("1123", "所在城市未填写", "City is not found"),

    IMAGE_UPLOAD_FAIL("1125", "头像上传失败", "Picture upload failed"),
    IMAGE_NOT_SUPPORTED("1126", "不支持的图片类型", "Image type not supported"),

    // 用户名密码登录
    MOBILE_NOT_FOUND("1130", "手机号未填写", "Mobile not found"),
    PASSWORD_NOT_FOUND("1131", "密码未填写", "Password not found"),
    LOGIN_FAIL("1132", "手机号或密码错误", "Mobile or password error"),
    LOGIN_EXCEEDED_LIMIT("1133", "超过x次登录限制，n时间内不能再次登录", "Login exceeded limit"),
    TOKEN_NOT_FOUND("1135", "Token不存在或者已过期", "Token not found"),

    // 老师排期 conflict
    TIME_CONFLICT("1201", "时间冲突", "Time conflict!"),
    TIME_NOT_VALID("1202", "必须选择2周以后的时间", "You must choose the time after 2 weeks"),

    // 老师、学生取消
    CP_NOT_ENOUGH("1205", "CP不足20无法取消", "CP not enough 20"),
    LESS_THAN_24_HOUR("1206", "距上课时间不足24小时，无法取消", "The class is less than 24 hours and can not be canceled"),

    // 学生预约
    APPOINTMENT_IS_EXISTS("1211", "已经存在一个有效的预约，请上完课或取消之后再预约", "A valid reservation already exists. Please make an appointment after class or cancel"),
    APPOINTMENT_NOT_VALID("1212", "必须选择48小时以后的时间", "You must choose the time after 48 hours"),
    LECTURES_NOT_ENOUGH("1213", "课时不足，请充值课时", "Class is short, please recharge your class"),
    MATCH_FAIL("1214", "没有可匹配的老师，选择其他时间", "No match for the teacher, choose other time"),
    CHAPTER_COMPLETE("1215", "太棒啦，您所有的课程都学习完啦！", "That's great. You've finished all your classes!"),

    // 准入规则
    CLASSROOM_STATUS_ILLEGAL("1301","教室状态异常","classroom status not valid"),
    CLASSROOM_STATUS_ILLEGAL_ENTER("1311","进入教室，教室状态异常","classroom status not valid"),
    CLASSROOM_STATUS_ILLEGAL_ENTER_WAIT("1312","进入教室，教室状态为等待匹配","classroom status not valid,wait"),
    CLASSROOM_STATUS_ILLEGAL_ENTER_SUCC("1313","进入教室，教室状态为匹配成功","classroom status not valid,success"),
    CLASSROOM_STATUS_ILLEGAL_ENTER_CANCEL("1314","进入教室，教室状态为取消","classroom status not valid,cancel"),
    CLASSROOM_STATUS_ILLEGAL_ENTER_EXCEPTION("1315","进入教室，教室状态为异常","classroom status not valid,exception"),
    CLASSROOM_STATUS_ILLEGAL_ENTER_FINISH("1316","进入教室，教室状态完成","classroom status not valid,finish"),
    
//    课程结束
    NOT_IN_TIME("1302","不在授课时间段内","not in time"),
//    评价
    CLASSROOM_STATUS_ILLEGAL_EVALUATION("1321","评价教室状态异常","classroom status not valid"),
    CLASSROOM_STATUS_ILLEGAL_EVALUATION_ENTER_WAIT("1322","进入教室，教室状态为等待匹配","classroom status not valid,wait"),
    CLASSROOM_STATUS_ILLEGAL_EVALUATION_ENTER_SUCC("1323","进入教室，教室状态为匹配成功","classroom status not valid,success"),
    CLASSROOM_STATUS_ILLEGAL_EVALUATION_ENTER_CANCEL("1324","进入教室，教室状态为取消","classroom status not valid,cancel"),
    CLASSROOM_STATUS_ILLEGAL_EVALUATION_ENTER_EXCEPTION("1325","进入教室，教室状态为异常","classroom status not valid,exception"),
    CLASSROOM_STATUS_ILLEGAL_EVALUATION_ENTER_FINISH("1326","进入教室，教室状态完成","classroom status not valid,finish"),
    T2S_COMMENT_EXISTS("1345","老师已评价该学生","You have already evaluated the student!"),
    
    // 礼包
    GIFT_HASH_RECEIVED("1601", "礼包已经领取够", "The package has been collected enough"),
    GIFT_NOT_COND("1602", "不符合礼包领取条件", "Do not meet the conditions"),
    GIFT_NOT_FOUND("1603", "没有可领取的礼包", "Gift not found"),

    







    // ==============================================================================================  //
    // old
//    NEED_LOGIN("1001", "请先登录", "need login!"),
    
//    NEED_MORE_BALANCE("1002","剩余课时不足","need more class hour"),
    
    /**用户准入性校验*/
//    USER_TYPE_ILLEGAL("1300", "用户类型异常", "user not valid"),
    
    /**用户准入性校验*/
    
    /**数据存在性校验*/
    
    
    
    /**数据存在性校验*/
    
    


    SMS_EXCEED_LIMIT("1740","短信发送超过次数","sms exceed limit"),
    SMS_EXPIRE("1741","验证码已过期","sms code out of date"),
    SMS_ERROR("1742","短信发送失败","sms send failed"),
    SMS_VALID_ERROR("1743","短信验证错误","sms code is wrong"),
    ;



    ResultCode(String code, String cn, String en) {
        this.code = code;
        Dictionary.build(code, cn, en);
    }

    public final String code;

    public String getCode() {
        return code;
    }

    public String getCn() {
        return Dictionary.getCn(this.code);
    }

    public String getEn() {
        return Dictionary.getEn(this.code);
    }

}
